package com.bainaeco.framework.base.model;

import java.io.Serializable;
import java.util.Date;

import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.bainaeco.framework.enums.IsDelete;
import com.bainaeco.framework.util.DateUtil;

import com.bainaeco.framework.util.serializer.CustomDateSerializerHMS;

public abstract class BaseModel implements Serializable {

	private static final long serialVersionUID = 4817236725364974536L;

	protected String id;
	
	@DateTimeFormat(pattern = DateUtil.DATETIME_PATTERN_DEFAULT)
	@JsonSerialize(using = CustomDateSerializerHMS.class)
	protected Date createdTime;

	protected String createdBy;

	@JsonSerialize(using = CustomDateSerializerHMS.class)
	protected Date updatedTime;

	protected String updatedBy;
	
	protected Integer isDelete = IsDelete.NO.toIntValue();

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Date getCreatedTime() {
		return createdTime;
	}

	public void setCreatedTime(Date createdTime) {
		this.createdTime = createdTime;
	}

	public String getCreatedBy() {
		return createdBy;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	public Date getUpdatedTime() {
		return updatedTime;
	}

	public void setUpdatedTime(Date updatedTime) {
		this.updatedTime = updatedTime;
	}

	public String getUpdatedBy() {
		return updatedBy;
	}

	public void setUpdatedBy(String updatedBy) {
		this.updatedBy = updatedBy;
	}

	public Integer getIsDelete() {
		return isDelete;
	}

	public void setIsDelete(Integer isDelete) {
		this.isDelete = isDelete;
	}

}
